package www.matiji.net;

import java.util.Scanner;

/**
 * @version 1.8
 * @Author Djx_hmbb
 * @Date 2023/8/4 17:03
 * @注释:练习
 */
public class Day01 {

    //MT1016宽度与对齐
    public static void main(String[] args) {
        /*
        * 输出455、-123、987654，宽度为5，分别左对齐和右对齐
        * 输出 455     455
        *      -123   -123
        *      987654 987654
        */
        int a = 455;
        int b = -123;
        int c = 987654;
        System.out.printf("%-5d ",a);
        System.out.printf("%5d\n",a);
        System.out.printf("%-5d ",b);
        System.out.printf("%5d\n",b);
        System.out.printf("%-5d ",c);
        System.out.printf("%5d\n",c);
    }

    //输入分隔符
    public static void main2(String[] args) {
        /* 输入格式：a=22,b=b,c=14,d=d
          *输出格式：空格分隔
          *输入：a=22,b=b,c=14,d=d
          *输出：22 b 14 d
         */
        Scanner input = new Scanner(System.in);
        // code here
        String[] arr = input.next().split(",");
        //输出
        for(int i=0;i<arr.length;i++){
            String[] tmp = arr[i].split("=");
            System.out.print(tmp[1]+" ");
        }
    }

    //调和级数不等式
    public static void main1(String[] args) {
        Scanner input = new Scanner(System.in);
        // code here

        int n = input.nextInt();
        int[] arr = new int[n];
        for (int i = 0; i < arr.length; i++) {
            arr[i] = input.nextInt();
        }
        if(n == 0){
            System.out.println("no");
        }
        //只要有一个不一样的
        int tmp = arr[0];
        for(int i:arr){
            if(tmp != i){
                System.out.println("yes");
                System.exit(0);
            }
        }
        System.out.println("no");
    }
}
